@extends('admin.app')

@section('breadcrumb')
    <div class="bg-light lter b-b wrapper-md">
        <ol class="breadcrumb bg-light lter m-n no-padder">
            <li><a href="{{ admin_action('HomeController@index') }}">主页</a></li>
            <li>业务管理</li>
            <li><a href="{{ admin_action('Business\UsersController@index') }}">用户管理</a></li>
            <li class="active">新增用户</li>
        </ol>
    </div>
@endsection

@section('content')
    <div class="panel panel-default">
        <div class="panel-heading font-bold">
            用户信息表单
        </div>
        <div class="panel-body">
            <form enctype="multipart/form-data" class="form-horizontal form-validation"
                  action="{{ admin_action('Business\UsersController@store') }}"
                  method="post">
                {{ csrf_field() }}
                <label>账户信息</label>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">用户名*</label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="username" value="{{ old('username') }}"
                               placeholder="请输入用户名" data-rule-pattern="[a-zA-Z]\w{5,17}"
                               data-msg-pattern="有效格式位 字母 数字 或下划线 长度为 6-18位" data-rule-required="true"
                               data-rule-remote="{{ action('Utils\UtilsController@userNameExists') }}"
                               data-msg-remote="此用户名已经存在">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">密码*</label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="password"
                               value="{{ old('password')??'bbl123456' }}">
                    </div>
                </div>
                <!-- <div class="line line-dashed b-b line-lg"></div>
                <label>用户信息</label>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">邮箱地址</label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="email" value="{{ old('email') }}"
                               placeholder="请填写用户邮箱地址" data-rule-pattern="\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}"
                               data-msg-pattern="邮箱格式不正确">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">手机号码</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="phone_number" value="{{ old('phone_number') }}"
                               placeholder="请填写用户手机号码" data-rule-pattern="0?(13|14|15|18)[0-9]{9}"
                               data-msg-pattern="手机号码格式不正确,或者号段不支持">
                    </div>
                </div> -->
                <div class="line line-dashed b-b line-lg"></div>
                <label>附加信息</label>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">推荐人编号</label>
                    <div class="col-lg-4">
                        <input type="tel" class="form-control" name="recommended" value="{{ old('recommended') }}"
                               placeholder="请填写推荐人编号">
                    </div>  
                </div>

                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <div class="col-lg-4 col-lg-offset-2">
                        <a href="javascript:history.back()"
                           class="btn btn-default">返&nbsp;回</a>
                        <button type="submit" class="btn btn-primary">保&nbsp;存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
@endsection